package com.rc.saas.tenant.vo.elec;

import com.rc.saas.tenant.common.annotation.Excel;
import com.rc.saas.tenant.model.elec.ElecStation;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.logging.SimpleFormatter;

/**
 * @author frog
 * @data 2019/9/24
 */
public class ElecStationPrintVo {
    @Excel(title = "桩群编号")
    private String stationNo;
    @Excel(title = "桩群名称")
    private String stationName;
    @Excel(title = "站点类型")
    private String stationType;
    @Excel(title = "省")
    private String provinceName;
    @Excel(title = "市")
    private String cityName;
    @Excel(title = "区")
    private String areaName;
    @Excel(title = "地址详情")
    private String address;
    @Excel(title = "开始营业时间")
    private String bizStartTime;
    @Excel(title = "结束营业时间")
    private String bizEndTime;
    @Excel(title = "营业类型")
    private String bizType;
    @Excel(title = "纬度")
    private BigDecimal latitude;
    @Excel(title = "经度")
    private BigDecimal longitude;
    @Excel(title = "营业状态")
    private String operateStatus;
    @Excel(title = "停车备注")
    private String parkingRemark;
    @Excel(title = "开通时间")
    private String createdTime;
    @Excel(title = "桩数量")
    private Integer pileCount;

    public ElecStationPrintVo(ElecStation elecStation) {
        super();
        this.stationNo = elecStation.getStationNo();
        this.stationName = elecStation.getStationName();
        //站点类型,1: 公共；50: 个人；100: 公交（专用）；101: 环卫（专用）；102: 物流（专用）；103: 出租车（专用）；255: 其他
        switch (elecStation.getStationType()) {
            case 1:
                this.stationType = "公共";
                break;
            case 50:
                this.stationType = "个人";
                break;
            case 100:
                this.stationType = "公交";
                break;
            case 101:
                this.stationType = "环卫(专用)";
                break;
            case 102:
                this.stationType = "物流(专用)";
                break;
            case 103:
                this.stationType = "出租车(专用)";
                break;
            case 255:
                this.stationType = "其他";
                break;
        }
        this.provinceName = elecStation.getProvinceName();
        this.cityName = elecStation.getCityName();
        this.areaName = elecStation.getAreaName();

        if (StringUtils.isNotEmpty(elecStation.getAddress())) {
            this.address = elecStation.getAddress();
        } else {
            this.address = "";
        }
        if (StringUtils.isNotEmpty(elecStation.getBizStartTime())) {
            this.bizStartTime = elecStation.getBizStartTime();
        } else {
            this.bizStartTime = "";
        }
        if (StringUtils.isNotEmpty(elecStation.getBizEndTime())) {
            this.bizEndTime = elecStation.getBizEndTime();
        } else {
            this.bizEndTime = "";
        }
        //营业类型 (0自营 1非自营) 默认0
        if ("0".equals(elecStation.getBizType())) {
            this.bizType = "自营";
        } else if ("1".equals(elecStation.getBizType())) {
            this.bizType = "非自营";
        }

        this.latitude = elecStation.getLatitude();
        this.longitude = elecStation.getLongitude();

        if ("0".equals(elecStation.getOperateStatus())) {
            this.operateStatus = "未上线";
        } else if ("1".equals(elecStation.getOperateStatus())) {
            this.operateStatus = "上线";
        } else if ("2".equals(elecStation.getOperateStatus())) {
            this.operateStatus = "下线";
        }
        if (StringUtils.isNotEmpty(elecStation.getParkingRemark())) {
            this.parkingRemark = elecStation.getParkingRemark();
        } else {
            this.parkingRemark = "";
        }
        if (elecStation.getCreatedTime() != null) {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            this.createdTime = sdf.format(elecStation.getCreatedTime());
        } else {
            this.createdTime = null;
        }
        this.pileCount = elecStation.getTotalPileNum();

    }

    public Integer getPileCount() {
        return pileCount;
    }

    public void setPileCount(Integer pileCount) {
        this.pileCount = pileCount;
    }

    public String getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(String createdTime) {
        this.createdTime = createdTime;
    }

    public String getStationNo() {
        return stationNo;
    }

    public void setStationNo(String stationNo) {
        this.stationNo = stationNo;
    }

    public String getStationName() {
        return stationName;
    }

    public void setStationName(String stationName) {
        this.stationName = stationName;
    }

    public String getStationType() {
        return stationType;
    }

    public void setStationType(String stationType) {
        this.stationType = stationType;
    }

    public String getProvinceName() {
        return provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getBizStartTime() {
        return bizStartTime;
    }

    public void setBizStartTime(String bizStartTime) {
        this.bizStartTime = bizStartTime;
    }

    public String getBizEndTime() {
        return bizEndTime;
    }

    public void setBizEndTime(String bizEndTime) {
        this.bizEndTime = bizEndTime;
    }

    public String getBizType() {
        return bizType;
    }

    public void setBizType(String bizType) {
        this.bizType = bizType;
    }

    public BigDecimal getLatitude() {
        return latitude;
    }

    public void setLatitude(BigDecimal latitude) {
        this.latitude = latitude;
    }

    public BigDecimal getLongitude() {
        return longitude;
    }

    public void setLongitude(BigDecimal longitude) {
        this.longitude = longitude;
    }

    public String getOperateStatus() {
        return operateStatus;
    }

    public void setOperateStatus(String operateStatus) {
        this.operateStatus = operateStatus;
    }

    public String getParkingRemark() {
        return parkingRemark;
    }

    public void setParkingRemark(String parkingRemark) {
        this.parkingRemark = parkingRemark;
    }
}
